package com.example.mapper;

import com.example.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 添加用户
     */
    @Insert("insert into user(username,password,phone,sex,id,nick,avatar,create_time) " +
            "values(#{username},#{password},#{phone},#{sex},#{id},#{nick},#{avatar},#{createTime})")
    public int insert(User user);

    @Select("select * from user where username=#{username}")
    User selectByName(String username);
}
